package com.team9.fitness.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 运动信息实体
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ExerciseInfo {
    private Long id;
    private String name; // 运动名称
    private String category; // 运动分类
    private String description; // 运动描述
    private Boolean hasSpeed; // 是否有速率（如跑步）
    private Boolean hasHeartRate; // 是否有心率
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    public void setCreatedAtIfNull() {
        if (this.createdAt == null) {
            this.createdAt = LocalDateTime.now();
        }
    }

    public void setUpdatedAtIfNull() {
        this.updatedAt = LocalDateTime.now();
    }
}




